<template>
  <section  id="section">
  <div v-if="nomessage">
    <div class="card">
      <img class="tou" :src="this.$photoUrl+doctorMessage.AvatarUrl" alt="">
      <p class="one">{{doctorMessage.Name}}
            <span class="type">医生</span>
              <img v-if="doctorMessage.Gender==0" src="../../assets/nan.png" alt="">
        <span v-else>
              <img src="../../assets/nv.png" alt="">
        </span>
      </p>
      <p class="one" style="margin-top: 5px;margin-bottom: 5px;">{{doctorMessage.HospitalName}}</p>

      <p><span>职称：</span>{{doctorMessage.JobTitle}}</p>
      <p class="left">擅长癌种</p>
      <p class="shanchang">
                  {{doctorMessage.GoodATCancer}}
      </p>
    </div>
  </div>
  <div v-if="nodoctor">
    <p style="height:90px;line-height:90px;font-size: 14px;font-weight: bold;color: gray;">您还没有医生</p>
    <img src="../../assets/medical.png" alt="" width="200px">
  </div>
  </section>

</template>

<script>
  import { Indicator } from "mint-ui";
  import {getPatientDoctorInfo} from "../../api/api"
  export default {
    props: [],
    name: 'app',
    data(){
      return {
        doctorMessage:{},
        nomessage:false,
        nodoctor:false
      }
    },
    computed: {},
    components: {},
    created(){
    },
    methods: {
      PatientDoctorInfo(){
        Indicator.open({
          spinnerType: 'fading-circle'
        });
        getPatientDoctorInfo(localStorage.getItem("choosePatientId")).then(res=>{ 
            if(res.data.Result){
              Indicator.close();
              this.doctorMessage=res.data.Result;
              this.nomessage=true;
              this.nodoctor=false;
            }
            else{
              Indicator.close();
              this.doctorMessage={};
              this.nomessage=false;
              this.nodoctor=true;
            }
        });
      }
    },
    mounted() {
      document.getElementById("section").style.minHeight=localStorage.getItem("windowHeight")+"px";
      this.PatientDoctorInfo();
    },
    destroyed(){
    }
  }
</script>

<style lang="scss" scoped>
  #section{
    /*background-color: rgba(220, 220, 220, 0.2);*/
  }
  .card{
    width: 100%;
    margin: 0 auto;
    border-radius: 5px;
    background-color: white;
    text-align: left;
    .tou{
      display: inline-block;
      width: 100px;
      height: 100px;
      margin-top: 30px;
      margin-bottom: 30px;
      border-radius: 10px;
      margin-left: 5%;
    }
    p{
      width: 90%;
      margin: 0 auto;
      text-align: left;
      line-height: 35px;
      font-size: 15px;
    }
    .one{
      font-size: 18px;
      font-weight: bold;
      color: rgba(0,0,0,0.82);
      display: flex;
      align-items: center;
      img{
        width: 30px;
        height:30px;
        margin-left: 20px;
        margin-top: 10px;
      }
    }
    .type{
      display: inline-block;
      width:40px;
      height: 20px;
      font-size: 13px;
      color: white;
      line-height: 20px;
      text-align: center;
      background-color: rgba(0, 146, 252, 0.5);
      border-radius: 10px;
      margin-left: 20px;
    }
  }
  .left{
    line-height: 50px;
  }
  .shanchang{
    min-height:200px;
  }
</style>
